/*
Realistic Unit Modification v4.0 Dialog 
v4.0.0.1 [ALPHA]
Concept & Development by Draper & Raps | [VRC]
*/

private ["_helo","_callsign","_mkrname","_asloc","_mkrname2","_asloc2","_class","_pilot","_grp","_payload"];

/* checked the RUM settings for the non spawn helos on station */
if (RUM_AHEL_NonSpawn) then {
	_helo = _this select 0;
} else {
	_helo = _this select (count _this - 1);
};

/* defines variables */
_callsign = _this select 1;
_class = _this select 2;

/* need a more dynamic marker for when helo is on station or moving into station with color - TODO */
_mkrname = format ["%1station",_helo];
_asloc = createMarker [_mkrname, getPos _helo];
_asloc setMarkerShape "ELLIPSE";
_mkrname setMarkerBrush "BORDER";
_mkrname setMarkerSize [100,100];
_mkrname setMarkerColor "ColorGreen";
_mkrname setMarkerText _callsign;
_mkrname2 = format ["%1station2",_helo];
_asloc2 = createMarker [_mkrname2, getmarkerpos _mkrname];
_asloc2 setMarkerShape "ICON";
_mkrname2 setMarkerSize [1,1];
_mkrname2 setMarkerType "mil_Dot";
_mkrname2 setMarkerColor "ColorGreen";
_mkrname2 setMarkerText _callsign;

/* defines the pilot and gunner */
_pilot = driver _helo;
_gunner = gunner _helo;

/* defines group by pilot faction/side */
_grp = group _pilot;

/* sets the altitude of the stationed helo */
_helo flyInheight RUM_AHel_flyStationHeight;

/* sets the combatMode of the helo while on station */
_grp setCombatMode "GREEN";

/* performs check in process to controlling units on start */
if (RUM_AHEL_flightCheckIn) then {
	["flightcheckin",[player,_pilot,_callsign,_payload]] execVM (RUM_PATH+"AHel\radiodialogs.sqf");
};

/* exits script */
if (true) exitwith {};
